package task

import (
	"go-task/common"
	"go-task/data"
	"net"
)

type HeartbeatTaskHandler struct {
}

func NewHeartbeatTaskHandler() *HeartbeatTaskHandler {
	return &HeartbeatTaskHandler{}
}

func (p *HeartbeatTaskHandler) Handler(s *TaskServer, conn net.Conn, msgData *data.MsgData) {
	resp := data.MsgData{
		Action: data.HEARTBEAT,
		Data:   "HEARTBEAT_ACK",
	}
	s.sendData(conn, common.JsonBytes(resp))
}
